package com.yizhuoyan.his.webapi.controller.department;

import com.yizhuoyan.his.ao.DepartmentCategoryAo;
import com.yizhuoyan.his.dto.JSONResponse;
import com.yizhuoyan.his.service.department.DepartmentCategoryManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DepartmentCategoryManageController {

    @Autowired
    DepartmentCategoryManageService service;
    @PostMapping("/api/addDepartmentCategory")
    public JSONResponse addDepartmentCategory(DepartmentCategoryAo ao)throws Exception{
        service.addDepartmentCategory(ao);
        return JSONResponse.ok();
    }
    @PostMapping("/api/modifyDepartmentCategory")
    public JSONResponse modifyDepartmentCategory(Long id,DepartmentCategoryAo ao)throws Exception{
        service.modifyDepartmentCategory(id,ao);
        return  JSONResponse.ok();
    }
    @PostMapping("/api/queryDepartmentCategoryById")
    public JSONResponse queryDepartmentCategoryById(Long id)throws Exception{
        service.queryDepartmentCategoryById(id);
        return JSONResponse.ok();
    }
    @PostMapping("/api/removeDepartmentCategoryById")
    public JSONResponse removeDepartmentCategoryById(Long id)throws Exception{
        service.removeDepartmentCategoryById(id);
        return  JSONResponse.ok();
    }
}
